package cn.edu.njnu.controller;

import cn.edu.njnu.pojo.Result;
import cn.edu.njnu.pojo.ResultFactory;
import cn.edu.njnu.util.EmailSender;
import com.sun.mail.smtp.SMTPSendFailedException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/e-resource/api")
public class EmailController extends BaseController{
    @Autowired
    private EmailSender emailSender;
    @GetMapping("/v1.0/public/email/{address}")
    public Result sendEmail(@PathVariable("address") String emailAddress) throws Exception {
//        emailSender.sendVerifyMsg(emailAddress);
        return ResultFactory.buildSuccessResult("邮件发送成功",null);
    }
}
